package com.zhushenwudi.base.network

import com.zhushenwudi.base.R
import com.zhushenwudi.base.app.appContext

/**
 * 作者　: hegaojian
 * 时间　: 2019/12/17
 * 描述　: 错误枚举类
 */
enum class Error(private val code: String, private val err: String) {

    UNKNOWN("1000", appContext.getString(R.string.base_request_was_aborted)),

    PARSE_ERROR("1001", appContext.getString(R.string.base_parsing_error)),

    NETWORK_ERROR("1002", appContext.getString(R.string.base_network_connection_error)),

    SSL_ERROR("1003", appContext.getString(R.string.base_certificate_error)),

    TIMEOUT_ERROR("1004", appContext.getString(R.string.base_network_connection_timeout)),

    AUTHOR_VERIFY_FAIL("1005", appContext.getString(R.string.base_authentication_failed)),

    SERVER_ERROR("1006", appContext.getString(R.string.base_busy_service)),

    DNS_ERROR("1007", appContext.getString(R.string.base_domain_name_error)),

    NO_NET_ERROR("1008", appContext.getString(R.string.base_please_connect_to_the_network));

    fun getValue(): String {
        return err
    }

    fun getKey(): String {
        return code
    }

}